package com.czp.framework.mapper;

import java.util.List;

import org.mybatis.spring.support.SqlSessionDaoSupport;

/**
 * 【环 境】：J2SE 1.7
 * 
 * @author 柴志鹏
 * @version version 1.0
 * @since 2014-4-30
 */
public class BaseMapperSupport extends SqlSessionDaoSupport {

	public int batchInsert(String statement, List<?> list) {
		int i = 0;
		for (int cnt = list.size(); i < cnt; i++) {
			getSqlSession().insert(statement, list.get(i));
		}
		return i;
	}

	public int batchUpdate(String statement, List<?> list) {
		int i = 0;
		for (int cnt = list.size(); i < cnt; i++) {
			getSqlSession().update(statement, list.get(i));
		}
		return i;
	}

	public int batchDelete(String statement, List<?> list) {
		int i = 0;
		for (int cnt = list.size(); i < cnt; i++) {
			getSqlSession().delete(statement, list.get(i));
		}
		return i;
	}

	
}
